package cn.edu.scau.cmi.zhengweibo.client;

import java.util.Scanner;

import cn.edu.scau.cmi.zhengweibo.Factory.BeefMeatFactory;
import cn.edu.scau.cmi.zhengweibo.Factory.ChickenMeatFactory;
import cn.edu.scau.cmi.zhengweibo.Factory.MeatFactory;
import cn.edu.scau.cmi.zhengweibo.Factory.PorkMeatFactory;
import cn.edu.scau.cmi.zhengweibo.simpleFactoryMethod.domain.Meat;

public class FactoryClient {

	public static void main(String[] args) {
		System.out.println("请输入你想要的肉类：");
		Scanner scanner = new Scanner(System.in);  
		String meatKind = scanner.next();  
		MeatFactory meatFactory=null;
		switch(meatKind) {
		case "beef": 
			meatFactory=new BeefMeatFactory();
			break;
		case "pork": 
			meatFactory=new PorkMeatFactory();
			break;
		case "chicken": 
			meatFactory=new ChickenMeatFactory();
			break;
		default:System.out.println("对不起，输入有误");
		
		}
		if(meatFactory!=null) {
			Meat meat=meatFactory.getMeat();
			meat.cook();
		}
	}
}